//
//      Copyright Timothy Evans 2014 2015    timothy.evans@gsecraif.org
//
//      This file is part of gsecraif.
//
//      gsecraif is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 3 of the License, or
//      (at your option) any later version.
//
// comb_functions
//

using namespace std;

#ifndef COMB_FUNCTIONS_H
#define COMB_FUNCTIONS_H

#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>

#include "int2asciistr.h"
#include "parity.h"
#include "bit_rotate.h"
#include "bit_transpose.h"
#include "parse_args.h"
#include "print_help.h"
#include "stripe.h"
#include "errors_text.h"

void combine_files(int numoffiles, unsigned short int rrotate, bool transpose, 
                   vector<string> &compfilenames);

bool check_comp_file_format_version(int numoffiles,
                                    unsigned short int missingfileid,
                                    vector<unsigned char> header,
                                    char fileformatversion );

bool check_comp_count(int numoffiles,
                      unsigned short int missingfileid,
                      vector<unsigned char> header );

bool check_which_comp(int numoffiles,
                      unsigned short int missingfileid,
                      vector<unsigned char> header );

bool check_rotate(int numoffiles, unsigned short int missingfileid,
                  vector<unsigned char> header );

void read_stripe(int numoffiles,
                 unsigned short int missingfileid, 
                 vector<unsigned char> compmap, bool &finished,
                 Stripe &buffstripe, ifstream *infile );

#endif /* not COMB_FUNCTIONS_H */
